<?php include _include(APP_PATH . 'view/admin/htm/header.inc.htm'); ?>
<div class="row">
    <div class="col-12">
        <div class="page-header" id="top">
            <h2 class="pageheader-title">基本设置</h2>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-body">
                <form action="<?php echo url('shopadmin-shophost') ?>" method="POST" id="form">
                    <div class="form-group">
                        <label class="form-control-label" for="">你要申请的子域名</label>
                        <input type="text" class="form-control" value="<?php echo $shop['shophost']; ?>" id="shophost" name="shophost"></input>
                    </div>
                    <div class="form-group">
                        <label for="submit" class="orm-control-label"></label>
                        <button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<?php include _include(APP_PATH . 'view/admin/htm/footer.inc.htm'); ?>

<script>
    var jform = $('#form');
    var jsubmit = $('#submit');
    jform.base64_encode_file();
    jform.on('submit', function() {
        jform.reset();
        jsubmit.button('loading');
        var postdata = jform.serialize();
        $.xpost(jform.attr('action'), postdata, function(code, message) {
            if(code == 0) {
                $.alert(message);
                jsubmit.text(message).delay(1000).button('reset');
            } else if(xn.is_number(code)) {
                alert(message);
                jsubmit.button('reset');
            } else {
                jform.find('[name="'+code+'"]').alert(message).focus();
                jsubmit.button('reset');
            }
        });
        return false;
    });

    var logo = $('#logo');
    var logo_input = $('input[name="logo"][type="hidden"]');
    var logo_img = $('#logo_img');

    logo.on('change',function(){
        console.log('233')
        logo_img.attr('src',$('input[name="logo"][type="hidden"]').val());
    })
    
    
</script>